package cn.smile.config.shiro.realm;

import org.apache.shiro.authc.AuthenticationException;
import org.apache.shiro.authc.AuthenticationInfo;
import org.apache.shiro.authc.AuthenticationToken;
import org.apache.shiro.authz.AuthorizationInfo;
import org.apache.shiro.cas.CasRealm;
import org.apache.shiro.subject.PrincipalCollection;

/**
 * 自定义Realm
 *
 * @Author: MaoSuyu
 * @User：John
 * @Date: 2019/7/16
 * @Time: 12:10
 * @Description: No Description
 */
public class CustomRealm extends CasRealm {


    @Override
    protected AuthorizationInfo doGetAuthorizationInfo(PrincipalCollection principals) {
        System.out.println("*************授权***************");
        System.out.println(principals.getPrimaryPrincipal().toString());
        return super.doGetAuthorizationInfo(principals);
    }


}
